home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / AutoType Distrib / AutoType Documentation next >
Text File  |  1994-02-10  |  6KB  |  129 lines

  1. AutoType v. 1.1ur
  2. An OSAX to allow simulated keystrokes from a script.
  3.  
  4. Automate even applications that *dont* support AppleScript.
  5. If you can do it from the keyboard, now you can do it from a script.
  6. Menu Shortcuts, Dialog boxes, Text input, etc...
  7.  
  8. A poor mans QuickKeys. 
  9.  
  10. Unregistered version allows only A-Z.
  11. Registered version allows _any_ key.
  12. Registration cheap/free.
  13.  
  14. Copyright 1994 by James Davis. 
  15. Dont modify, sell for a profit etc..
  16. When in doubt, ask. 
  17. ------------------------------------------------
  18. Contact Info 
  19.  
  20. James Davis
  21. 1242 W. McKinley #1
  22. Sunnyvale, CA 94086
  23. jedavis@cs.stanford.edu
  24.  
  25. ------------------------------------------------
  26. Registration Info
  27.  
  28. 1) You get a better version if you register. 
  29.           All the keys, including function keys etc...
  30. 2) Its fast.  Send Email.  
  31.           You'll be registered and have your update within a day.
  32.           Put AUTOTYPE REGISTRATION on subject line.
  33. 3) I'd like $5, but Ill register you even if youre broke.
  34.           Use your judgement.  If youre a student volunteering 
  35.           with a nonprofit organization, free is ok.  If you have a regular
  36.           job, and actually write a script using it, $5 is 
  37.           appropriate. If you integrate something for your
  38.           company saving Ten Zillion dollars a year, $100 is
  39.           appropriate. Ill leave it to you to decide. 
  40.  
  41. A copy and paste registration form:
  42.  
  43. Use it if its convenient, just type free form
  44. email if not. 
  45.  
  46. Notice 'Company' on the second line, fill it
  47. in if youre using the OSAX in conjunction with a job,
  48. I want to say I wrote software registered by DEC, IBM,
  49. Apple, (insert your company here), etc...
  50. So if its getting used for work, (even a little) let me 
  51. know, so I can have bragging rights.
  52.  
  53. AUTOTYPE REGISTRATION
  54.  
  55. Name:
  56. Company:
  57. Email:
  58. Postal Address:
  59. Phone:
  60. Machine Type:
  61.  
  62. Agreement: I promise to pay James Davis a registration
  63. fee. I understand that I will receive a new version of
  64. the software via email, before payment is received.
  65. Im honest, Ill go ahead and pay even though I can get 
  66. the goods without.
  67.  
  68. Amount I agree to pay: (probably $5. If $0, please jusitfy)
  69.  
  70. ------------------------------------------------
  71. Documentation
  72.  
  73. Autotype allows you to simulate keyboard activity from  applescript. The keystrokes you specify will be sent to the front application.  Just use a line like...
  74.  
  75. AutoType "Some typing stuff" holding "Shift"
  76.  
  77. The 'holding' parameter is optional, but you can use it to specify which modifier keys you are holding down.  In the case above since we are holding shift, so the text would appear upercase if sent to a word processing application.  You can use "Command" to use keyboard shortcuts for menu items.
  78.  
  79. Autotype "String to type"
  80.         [holding "Shift Option Command Control"]  -- optional parameter 'String'
  81. ------------------------------------------------
  82. Special Keys
  83.  
  84. Use ` (Backquote - just below the ESC key) to indicate a special character.
  85.  
  86. Heres the list of keys...
  87. `ESC        `tab        `delete        `del        `f1 - `f15
  88. `help        `home            `pageup        `pagedown  `end  `clear  `capslock
  89. `shift  `control  `option  `command  `space  `return  
  90. `leftarrow  `rightarrow  `uparrow  `downarrow  `enter  `backslash
  91.  
  92. In case something you want isnt here, you can specify the keycode you want
  93. to hit yourself with quote-number, so for instance `38 is a J. See IM V-192 for complete code listings.  I assumed Extended Keyboard. This may cause problems for others, may not.
  94.  
  95. If you want to specify the ascii value not the keycode, use quote-#-number. So for example `#65 is A.
  96.  
  97. quote-quote to get the quote itself.  (``)
  98. ------------------------------------------------
  99. Notes and caveats
  100.  
  101. * This all works via OSEvents.  Im just inserting the events on the queue. Also a little mussing around to avoid overflowing.  So only apps that get keystrokes via events will get the message.  Some games read the keyboard directly. I cant do a thing about that.
  102.  
  103. * Make sure the application the keystroke is destined for is the front application, _before_ you send the autotype.  _IMPORTANT_
  104.  
  105. * Sending keystrokes to yourself doesnt work how you think it should.  Since the mac doesnt support multiple execution threads, your app cant be sending and receiving events at the same time.  The keystrokes end up getting queued until the script finishes, and your app gets them all at once. Since the mac only keeps 20 events, you only get the last 20 keystrokes. You can mostly avoid any problem by sending keystrokes from an applet and having them destined to be received by some other application like MSWord. This problem comes up with 'Script Menu' however, since the script is run from inside the application. 
  106. You should be able to have the script in script menu, actually launch an applet that does the real work, avoiding this problem. I havent tried it because I dont know how to launch something. 
  107.  
  108. * Getting nonscriptable applications to the front is sometimes a challenge since you cant send them an activate event.  Im thinking of some work arounds, for now youll just have to be creative. e.g. tell the finder to launch it for you. Use an OSAX that musses with the application menu. Make your script delay, while you go click on it. etc...
  109.  
  110. * Use holding "None" to hold none of the modifier keys.  Subtly different than leaving off the holding parameter. e.g.
  111. autotype "AbCdEfG"                           - produces "AbCdEfG"
  112. autotype "AbCdEfG" holding "Shift"   - produces "ABCDEFG"
  113. autotype "AbCdEfG" holding "None"    - produces "abcdefg"
  114.  
  115. ------------------------------------------------
  116. Incompatibilities - Bugs
  117.  
  118. * Script Menu - Works fine, but see the Note above.
  119.  
  120. ------------------------------------------------
  121. Version History
  122.  
  123. 1.0 Beta testers only.
  124. 1.1 General Release.
  125.           Fixed `downarrow and `rightarrow to work correctly.
  126. ------------------------------------------------
  127. ------------------------------------------------
  128.  
  129.